package com.pic.mgt.syushin;

import com.pic.mgt.controller.MessageUnitController;
import com.pic.mgt.executer.UnitDispatcher;
import com.pic.mgt.unit.Message;

public final class SyushinMessageUnitController extends MessageUnitController {
	private UnitDispatcher syushinMessageUnitDispatcher;
	
	@Override
	protected String checkIsEffectiveTerminal(Message message) {
		// 集信這裡不需要做 "確認是否為有效端末" 的動作，所以 always return null
		return null;
	}
	
	@Override
	public void doMessageAction(Message message) {
		// 直接交給 UnitDispatcher 做執行
		this.syushinMessageUnitDispatcher
						.sendToUnitExecuter(message);
	}
	
	// --- getter and setter ---

	public void setSyushinMessageUnitDispatcher(
			UnitDispatcher syushinMessageUnitDispatcher) {
		this.syushinMessageUnitDispatcher = syushinMessageUnitDispatcher;
	}

}
